Page({
    data: {
        healthList: [{
            title: '身体质量指数测试',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 0,
            desc: '科学计算配比，定制你的私人健康菜单',
            goodsId: '1',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的身高是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }],
            array: ['140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '150',
                '151', '152', '153', '154', '155', '156', '157', '158', '159', '160',
                '161', '162', '163', '164', '165', '166', '167', '168', '169', '170',
                '171', '172', '173', '174', '175', '176', '177', '178', '179', '180',
                '181', '182', '183', '184', '185', '186', '187', '188', '189', '190',
                '191', '192', '193', '199', '195', '196', '197', '198', '199', '200'
            ], // 身高
            arrayO: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, {
            title: "中心性肥胖标准测试",
            brief: '明星都在学习的健康知识秘籍，今天全部免费教你',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 11,
            desc: '明星都在学习的健康知识秘籍，今天全部免费教你',
            goodsId: 'jianfei',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的腰围是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的臀围是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }],
            array: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100'
            ], // 腰围
            arrayO: ['70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119',
                '120'
            ], // 臀围
        }, {
            title: "身体脂肪率测试",
            brief: '你的身体真的健康吗？赶紧来健康雷达检测一下吧',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 111,
            desc: '你的身体真的健康吗？赶紧来健康雷达检测一下吧',
            goodsId: 'leida',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的腰围是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }, ],
            array: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100'
            ], // 腰围
            arrayO: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, {
            title: "每日所需卡路里测试",
            brief: '你的身体真的健康吗？赶紧来健康雷达检测一下吧',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 111,
            desc: '你的身体真的健康吗？赶紧来健康雷达检测一下吧',
            goodsId: 'leida',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的年龄是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的身高是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option2: 0,
                    fs: 0,
                }]
            }, ],
            array: ['10',
                '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
                '21', '22', '23', '24', '25', '26', '27', '28', '29', '30',
                '31', '32', '33', '34', '35', '36', '37', '38', '39', '40',
                '41', '42', '43', '44', '45', '46', '47', '48', '49', '50',
                '51', '52', '53', '54', '55', '56', '57', '58', '59', '60',
            ], // 年纪
            arrayO: ['140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '150',
                '151', '152', '153', '154', '155', '156', '157', '158', '159', '160',
                '161', '162', '163', '164', '165', '166', '167', '168', '169', '170',
                '171', '172', '173', '174', '175', '176', '177', '178', '179', '180',
                '181', '182', '183', '184', '185', '186', '187', '188', '189', '190',
                '191', '192', '193', '199', '195', '196', '197', '198', '199', '200'
            ], // 身高
            array1: [
                '40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, {
            title: '健康体重范围测试',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 0,
            desc: '科学计算配比，定制你的私人健康菜单',
            goodsId: '1',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的身高是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }],
            array: ['140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '150',
                '151', '152', '153', '154', '155', '156', '157', '158', '159', '160',
                '161', '162', '163', '164', '165', '166', '167', '168', '169', '170',
                '171', '172', '173', '174', '175', '176', '177', '178', '179', '180',
                '181', '182', '183', '184', '185', '186', '187', '188', '189', '190',
                '191', '192', '193', '199', '195', '196', '197', '198', '199', '200'
            ], // 身高
            arrayO: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, {
            title: '运动健身补水测试',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 0,
            desc: '科学计算配比，定制你的私人健康菜单',
            goodsId: '1',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }],
            array: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, {
            title: '跑步卡路里消耗测试',
            img: 'http://fcdn.qiushilaile.com/game/default-2111621235012128.png',
            healthNum: 0,
            desc: '科学计算配比，定制你的私人健康菜单',
            goodsId: '1',
            timu: [{
                question: "您的性别是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-29991611050055611.jpg",
                options: [{
                    leap: "A",
                    option: "男生",
                    fs: 0,
                }, {
                    leap: "B",
                    option: "女生",
                    fs: 0,
                }, {
                    leap: "c",
                    option: "中性",
                    fs: 0,
                }, ]
            }, {
                question: "您的跑步里程是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option: 0,
                    fs: 0,
                }]
            }, {
                question: "您的体重是？",
                imgUrl: "https://fcdn.qiushilaile.com/adx/qualificationMaterials-14601611050074691.jpg",
                options: [{
                    option1: 0,
                    fs: 0,
                }]
            }],
            array: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
            arrayO: ['40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
                '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
                '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
                '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
                '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
                '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
                '100', '101', '102', '103', '104', '105', '106', '107', '108', '109',
                '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120'
            ], // 体重
        }, ],
    },
    onLoad: function(options) {
        console.log(options);
        if (options.value == '1') {
            this.setData({
                title: '你的身体质量指数是多少？',
                person: options.person,
                tool: '1',
                tip: '身体质量指数测试',
            });
        } else if (options.value == '2') {
            this.setData({
                title: '你的中心性肥胖标准是多少？',
                person: options.person,
                tool: '2',
                tip: '中心性肥胖标准测试',
            });
        } else if (options.value == '3') {
            this.setData({
                title: '你的身体脂肪率是多少？',
                person: options.person,
                tool: '3',
                tip: '身体脂肪率测试',
            });
        } else if (options.value == '4') {
            this.setData({
                title: '你的每日所需卡路里是多少？',
                person: options.person,
                tool: '4',
                tip: '每日所需卡路里测试',
            });
        } else if (options.value == '5') {
            this.setData({
                title: '你的健康体重范围是多少？',
                person: options.person,
                tool: '5',
                tip: '健康体重范围测试',
            });
        } else if (options.value == '6') {
            this.setData({
                title: '你的运动健身补水是多少？',
                person: options.person,
                tool: '6',
                tip: '运动健身补水测试',
            });
        } else if (options.value == '7') {
            this.setData({
                title: '你的跑步卡路里消耗是多少？',
                person: options.person,
                tool: '7',
                tip: '跑步卡路里消耗测试',
            });
        }
    },
    onShow() {
        this.setData({
            layerPopup: true,
        })
    },
    onReady() {
        this.setData({
            layerPopup: false,
        })
    },
    feedback() { // 反馈
        tt.navigateTo({
            url: '/pages/feedback/feedback'
        });
    },
    toTest() { // 前往各类测试题
        let num = this.data.tool - 1;
        let timu = JSON.stringify(this.data.healthList[num].timu);
        let array = JSON.stringify(this.data.healthList[num].array);
        let arrayO = JSON.stringify(this.data.healthList[num].arrayO);
        let array1 = JSON.stringify(this.data.healthList[num].array1);
        tt.navigateTo({
            url: '/pages/ceshi/ceshi?type=' + this.data.tool +
                '&timu=' + timu +
                '&array=' + array +
                '&arrayO=' + arrayO +
                '&array1=' + array1 +
                '&tip=' + this.data.tip
        });
    },
    closeClick() {
        this.setData({
            layerPopup: false,
        });
    },
    more() { // 查看更多
        tt.reLaunch({
            url: '/pages/home/home' // 指定页面的url
        });
    },
    ceshi() {
        tt.redirectTo({
            url: '/pages/tool/tool?value=1&person=123'
        });
    },
    ceshi1() {
        tt.redirectTo({
            url: '/pages/tool/tool?value=2&person=242'
        });
    },
    ceshi2() {
        tt.redirectTo({
            url: '/pages/tool/tool?value=4&person=56'
        });
    },
    onShareAppMessage() {
        let value = this.data.tool;
        console.log('value', value, this.data.person);
        // let shareUserId = tt.getStorageSync('dyUser').id;
        // console.log('goodsId', this.data.goodsId);
        // console.log(tt.getStorageSync('dyUser').uid)
        return {
            templateId: '', //分享的模版 id
            title: this.data.title, //分享的标题
            desc: this.data.title, // 分享的内容
            // path: `/pages/tool/tool?goodsId=` + this.data.goodsId +
            //     "&shareUserId=" + tt.getStorageSync('dyUser').uid +
            //     "&mId=" + tt.getStorageSync('dyUser').id, // 分享的路径
            path: `/pages/tool/tool?value=` + value +
                '&person=' + this.data.person
        }
    },
})